package com.spzx.user.api;

import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.constant.ServiceNameConstants;
import com.spzx.common.core.domain.R;
import com.spzx.user.api.domain.UpdateUserLogin;
import com.spzx.user.api.domain.UserAddress;
import com.spzx.user.api.domain.UserInfo;
import com.spzx.user.api.factory.RemoteUserInfoFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * ClassName: RemoteUserInfoService
 * Package: com.spzx.user.api.domain
 * Description:
 *
 * @Author 咚咚小圆帽
 * @Create 2025/3/25 16:27
 * @Version 1.0
 */
@FeignClient(
        contextId = "RemoteUserInfoService",
        value = ServiceNameConstants.USER_SERVICE,
        fallbackFactory = RemoteUserInfoFallbackFactory.class
)
public interface RemoteUserInfoService {

    @PostMapping("/userInfo/register")
    R<Boolean> register(@RequestBody UserInfo userInfo,
                        @RequestHeader(SecurityConstants.FROM_SOURCE)
                        String source);

    @GetMapping("/userInfo/info/{username}")
    R<UserInfo> getUserInfo(@PathVariable("username") String username,
                            @RequestHeader(SecurityConstants.FROM_SOURCE)
                            String source);

    @PutMapping("/userInfo/updateUserLogin")
    R<Boolean> updateUserLogin(@RequestBody UpdateUserLogin updateUserLogin,
                               @RequestHeader(SecurityConstants.FROM_SOURCE)
                               String source);

}
